home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 September / Chip_2001-09_cd1.bin / sharewar / webscrip / webscripter4s.exe / {app} / Libs / js_templates.lib < prev    next >
Encoding:
INI File  |  2001-07-11  |  2.3 KB  |  121 lines

  1. [var_declaration|Variable Declaration]
  2. var Name|;
  3. [var_assign|Variable Assignment]
  4. var Name| = value;
  5.  
  6. [function|Function]
  7. function Name|(parameters){
  8. // add code
  9. }
  10.  
  11. [if|if Statement]
  12. if(condition|){
  13. // add code if true
  14. }
  15. [if_else|if else Statement]
  16. if(condition|){
  17. // add code if true
  18. }else{
  19. // add code if false
  20. }
  21.  
  22. [if_else_if_else|if else if else Statement]
  23. if(condition|){
  24. // add code if true
  25. }else if(condition){
  26. // add code if true
  27. }else{
  28. // add code if false
  29. }
  30.  
  31. [conditional_variable|Conditional Variable Assignment]
  32. var Name| = (condition) ? trueValue : falseValue;
  33.  
  34. [for_loop_inc|for Loop Increment]
  35. for(var i = min; i <= max|; i++){
  36. // add code for increment
  37. }
  38.  
  39. [for_loop_dec|for Loop Decrement]
  40. for(var i = max; i >= min|; i--){
  41. // add code for decrement
  42. }
  43. [for_loop_break|for Loop Break]
  44. for(var i = min; i >= max|; i++){
  45.          if(condition){
  46.          // add code if true
  47.          break;
  48.          }
  49. // add code if false
  50. }
  51. [while_loop|while Loop]
  52. while(condition|){
  53. // add code
  54. }
  55. [while_loop_break|while Loop Break]
  56. while(condition|){
  57.          if(condition){
  58.          // add code
  59.          break;
  60.          }
  61. // add code if false
  62. }
  63. [do_while_loop|do while Loop]
  64. do{
  65. // add code
  66. }while(condition|);
  67. [with|with Statement]
  68. with(object|){
  69. objectProperty1 = value;
  70. objectProperty2 = value;
  71. }
  72.  
  73. [switch_int|switch Integers]
  74. switch(Integer value|){
  75.     case 0:
  76.          // add code if value is zero
  77.          break;
  78.     case 1:
  79.          // add code if value is one
  80.          break;
  81.     case 2:
  82.          // add code if value is two etc
  83.          break;
  84.     default:
  85.          // add code if value not recognized
  86. }    
  87. [switch_string|switch Strings]
  88. switch(String value|){
  89.     case "first string":
  90.          // add code if value is matched
  91.          break;
  92.     case "second string":
  93.          // add code if value is matched
  94.          break;
  95.     case "third string":
  96.          // add code if value is matched etc
  97.          break;
  98.     default:
  99.          // add code if value not recognized
  100. }    
  101. [array_new|New Array]
  102. var Name| = new Array();
  103.  
  104. [array_create|Create an Array]
  105. var Name| = new Array();
  106. Name[0] = value1;
  107. Name[1] = value2;
  108. Name[2] = value3;
  109. // etc
  110.  
  111. [array_compact|Create a Compact Array]
  112. var Name| = new Array(value1, value2, value3);
  113.  
  114. [comment|Single Line Comment]
  115. // add comment here|
  116. [comment_multi|Multiple Line Comment]
  117. /*
  118. add comment lines between asterisks
  119.  
  120. */
  121.